package com.gscitysfy.cus.drain.modules.reserveplan.controller;


import com.gscitysfy.cloudfrmwk.assistant.domain.Result;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanControlInfo;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanMnCar;
import com.gscitysfy.cus.drain.modules.reserveplan.service.IDrainReservePlanControlInfoService;
import com.gscitysfy.cus.drain.modules.reserveplan.service.IDrainReservePlanMnCarService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shenglin
 * @since 2022-11-15 14:28:05
 */
@RestController
@RequestMapping("/reserveplan/drain-reserve-plan-mn-car")
@Tag(name = "预案管理-应急车辆")
public class DrainReservePlanMnCarController {
    @Autowired
    IDrainReservePlanMnCarService drainReservePlanMnCarService;

    /**
     * 新增预案应急车辆列表
     *
     * @param drainReservePlanMnCars
     * @return
     */
    @PostMapping("/saveReservePlanMnCarInfo")
    @Operation(summary = "新增预案应急车辆列表", description = "新增预案应急车辆列表")
    public Result saveReservePlanMnCarInfo(@RequestBody List<DrainReservePlanMnCar> drainReservePlanMnCars) {
        return Result.content(drainReservePlanMnCarService.saveBathReservePlanMnCarInfo(drainReservePlanMnCars));
    }


    /**
     * 获取预案应急车辆列表
     *
     * @param infoId
     * @return
     */
    @PostMapping("/getReservePlanMnCarList")
    @Operation(summary = "获取预案应急车辆列表", description = "获取预案应急车辆列表")
    @Parameters({
            @Parameter(required = true, name = "infoId", description = "预案id"),
    })
    public Result getReservePlanMnCarList(String infoId) {
        return Result.content(drainReservePlanMnCarService.getReservePlanMnCarInfoList(infoId,null));
    }



    /**
     * 根据预案等级获取预案应急车辆列表
     *
     * @param infoId
     * @return
     */
    @PostMapping("/getReservePlanMnCarListByLevel")
    @Operation(summary = "根据预案等级获取预案应急车辆列表", description = "根据预案等级获取预案应急车辆列表")
    @Parameters({
            @Parameter(required = true, name = "infoId", description = "预案id"),
            @Parameter(required = true, name = "level", description = "预案等级"),
    })
    public Result getReservePlanMnCarListByLevel(String infoId,String level) {
        return Result.content(drainReservePlanMnCarService.getReservePlanMnCarInfoList(infoId,level));
    }
}
